-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Limit the automation-editor scaled-level tooltip to the grid #4308
Conversation
Here is another issue that sounds |
include/AutomationEditor.h
Outdated
@@ -173,6 +173,7 @@ protected slots: | |||
|
|||
// some constants... | |||
static const int SCROLLBAR_SIZE = 12; | |||
static const int LEFT_MARGIN = 63; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess you can calculate the left margin using VALUES_WIDTH
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As in using VALUES_WIDTH
instead of LEFT_MARGIN
in drawCross()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, though it doesn't need to be simple replacing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 19b0342.
src/gui/editors/AutomationEditor.cpp
Outdated
QToolTip::showText( tt_pos, QString::number( scaledLevel ), this ); | ||
|
||
// Limit the scaled-level tooltip to the grid | ||
if( mouse_pos.x() > LEFT_MARGIN && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you put a tab inside parentheses instead of a space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mistake. Fixed in d1dfe32.
src/gui/editors/AutomationEditor.cpp
Outdated
@@ -1099,8 +1098,8 @@ inline void AutomationEditor::drawCross( QPainter & p ) | |||
float scaledLevel = m_pattern->firstObject()->scaledValue( level ); | |||
|
|||
// Limit the scaled-level tooltip to the grid | |||
if( mouse_pos.x() > LEFT_MARGIN && | |||
mouse_pos.x() < right_margin && | |||
if( mouse_pos.x() > VALUES_WIDTH - 1 && // left_margin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think VALUES_WIDTH
would be better, because it matches the limit area to where you can edit points.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At VALUES_WIDTH - 1
, the cross' vertical line is visible, so the scaled-level tooltip should show there.
It is. It can be fixed with similar checks, so I will do it here. |
@zonkmachine After some thinking, I don't think d127517 is the best way to fix #2714. It feels clunky, and it's somewhat out of scope. I will try to fix it in a different way, but not here. |
This reverts commit d127517.
Fixes #3746.